@contentful/app-scripts
This project makes easy to perform some recurrent operations in Contentful's App Framework.
📥 Installation
Locally:
npm i --save @contentful/app-scripts
Globally:
npm i -g @contentful/app-scripts
⚙️ Usage
💻 CLI
When installed
$ contentful-app-scripts create-app-definition
Otherwise
$ npx --no-install @contentful/app-scripts create-app-definition
👨💻 Programmatic
const { createAppDefinition } = require('@contentful/app-scripts')
const { myCustomLogic } = require('./my-custom-logic')
(async function main() {
myCustomLogic();
await createAppDefinition.interactive()
})()
📜 API
Scripts exported from this module will all be in the following shape
interface Script<Result, Options> {
interactive: () => Result;
nonInteractive: (...options: Options) => Result;
}
:warning: Please note
Both interactive and nonInteractive version of the same script is meant to return the same result.
Create App Definition
Allows creating a new AppDefinition
provided a Content Management Token (more details here).
It only runs in interactive mode.
Example
$ contentful-app-scripts create-app-definition